Não testado.
Em creaturescripts/scripts:
deathProtect.lua
function onDeath(cid, corpse, deathList)
if (getPlayerStorageValue(cid, 17331) - os.time()) > 0 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
end
end
No login.lua:
registerCreatureEvent(cid, "DeathProtect")
Em creaturescripts.xml:
<event type="death" name="DeathProtect" event="script" value="deathProtect.lua">
Em actions/scripts:
protect.lua
local tempo = 1 -- em dias
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, 17331) - os.time()) <= 0 then
setPlayerStorageValue(cid, 17331, (tempo*24*3600)+os.time())
doCreatureSay(cid, "You are protected now!", TALKTYPE_ORANGE_1, cid)
else
doCreatureSay(cid, "You are still protected.", TALKTYPE_ORANGE_1, cid)
end
end
Em actions.xml:
<action itemid="ID_DO_ITEM" script="protect.lua" />






info
Grupo: Artesão
Registrado: 06/01/08
Posts: 137
Reputação: +10
Char no Tibia: LarissaxD
Alguém poderia fazer um script no qual quando o jogador usasse, ele ficaria um tempo tipo 1 dia sem perder lv e skills dps desse tempo perdia o efeito e se morrer perder lv e skills.
Agradeço desde já.
Editado Julho 26 por Gabrielkss